package edu.hubu.talentmanagementsystem.controller;


import edu.hubu.talentmanagementsystem.common.CommonResult;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.Serializable;

/**
 * @author moonlan
 * date 2021/2/7 下午3:36
 */
@SuppressWarnings(value = "unused")
public abstract class AbsCrudController<Entity, Id extends Serializable> {

    public abstract CommonResult selectOneById(Id id, String token);

    public abstract CommonResult selectAllOrderBy(String order, String token);

    public abstract CommonResult selectAllPagedOrderBy(@RequestParam(required = false, defaultValue = "1") Integer currentPage,
                                                       @RequestParam(required = false, defaultValue = "5") Integer pageSize, String order, String token);

    public abstract CommonResult selectLikePagedOrderBy(@RequestParam(required = false, defaultValue = "1") Integer currentPage,
            @RequestParam(required = false, defaultValue = "5") Integer pageSize, String order,
                                                        Entity entity, String token);

    public abstract CommonResult save(Entity entity, String token);

    public abstract CommonResult deleteById(Id id, String token);

    public abstract CommonResult updateById(Entity entity, String token);
}
